﻿<Table TItem="BindItem" Items="@Items.Take(10)" Height="200" IsBordered="true">
    <TableColumns>
        <TableColumn @bind-Field="@context.DateTime" Width="150" />
        <TableColumn @bind-Field="@context.Name" Width="100" />
        <TableColumn @bind-Field="@context.Address" />
    </TableColumns>
</Table>

@code {
    private static readonly Random random = new Random();

    /// <summary>
    /// 
    /// </summary>
    /// <returns></returns>
    protected static List<BindItem> GenerateItems() => new List<BindItem>(Enumerable.Range(1, 80).Select(i => new BindItem()
    {
        Id = i,
        Name = $"张三 {i:d4}",
        DateTime = DateTime.Now.AddDays(i - 1),
        Address = $"上海市普陀区金沙江路 {random.Next(1000, 2000)} 弄",
        Count = random.Next(1, 100),
        Complete = random.Next(1, 100) > 50
    }));

    /// <summary>
    /// 
    /// </summary>
    protected static IEnumerable<BindItem> Items { get; } = GenerateItems();
}
